<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="sjs.util.Common"%>
<%@page import="sjs.db.Access"%>
<%@page import="sjs.util.AccessResult"%>
<%@page import="sjs.bean.User"%>
<%@page import="sjs.bean.Greeting"%>
<%@page import="sjs.service.PMF"%>
<%@page import="java.util.Date"%>
<%@page import="sjs.service.EMF"%>
<%@page import="java.util.List"%>
<%@page import="sjs.bean.DelTest"%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>我的第一个google页面</title>
<%@ include file="/util/extjs.jsp"%>
<script type="text/javascript" src="../dwr/engine.js"></script>
<script type="text/javascript" src="../dwr/util.js"></script>
<script type="text/javascript" src="../dwr/interface/ajax.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript">
	function tryClick(){
			alert(55);
			ajax.AjaxTest("sjs222",function(data){
				alert(data);
			});
	}
	function del(){
		var id=document.getElementById("userid").value;
		ajax.deleteUser(id,function(data){
			alert(data);
		});
	}
	function add(){
		var id=document.getElementById("userid").value;
 		ajax.addUser(id,function(data){
			alert(data);
		});
	}
	function sss(){
		 
		   
	//	 var s='<?xml version="1.0" encoding="UTF-8"?><d><div id="aspnetForm">123456</div></d><b></b>';
		// var resxml=ajaxSyncCall("oo.jsp");
		// resxml=resxml.replace(/<[^>]+>/g,"*") ; 
		 //resxml=resxml.replace(/<[^>]+>/g,"*") ; 
	//	 var resxml="<ss df ss aa>555</ss>";
		/*	var resxml='<script language="JavaScript" type="text/javascript"> <!-- function checkdata()  { if(form2.ID.value.length<10 || form2.ID.value=="请输入你的运单编号！")'
					+' { alert("输入的运单不正确，请确认 !!") return false; } return true } function checkdata3() { if(formoa.site_code.value.length<1 || formoa.T1.value.length<1 || formoa.T2.value.length<1) '
					+' { alert("输入错误，请确认 !!") return false; } return true } function checkLogin(n) { var ID = document.getElementById("ID") '
					+' if (n == 0 && ID.value == "请输入你的运单编号！"){ID.value="";ID.style.cssText = "color:#000000;ime-mode:disabled; font-size: 10pt; border: #003366; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px"} '
					+' if (n == 1 && ID.value == ""){ID.value = "请输入你的运单编号！";ID.style.cssText = "color:#cccccc;ime-mode:disabled;font-size: 10pt; border: #003366; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px"}'
					+' } --> <//script>'
	 	 resxml=resxml.replace(/<script.*script>/g,"") ; 

		 
		 //resxml=resxml.replace(/<[^>]+>/g,"*") ;
	 	 alert(resxml)*/ 
	//	document.getElementById("divwin").innerHTML=getZtoInfo(document.getElementById("userid").value) 
		 var res=getZtoInfo_json(document.getElementById("userid").value);
		 if(res.err){
			 	alert(res.err);
		}else{
			for(var i=0;i<res.records.length;i++){
				var r=res.records[i];
				alert(r.track)
			}
		}
		// document.getElementById("divwin").innerHTML=resxml;
		 
		//var domxml= createXml(s);
	//	var code=domxml.getElementsByTagName("div");
	//	alert(code.item.length);
		//var o=createXml(s);
		//alert(s.getElementById("aspnetForm").innerHTML)
		/*
		 var resxml=ajaxSyncCall("oo.jsp");
		 document.getElementById("divwin").innerHTML=resxml;
		 var a= document.getElementById("divwin").getElementsByTagName("FORM");
		 for(var i=0;i<a.length;i++){
			if(a[i].id=="aspnetForm"){
				document.getElementById("divwin").innerHTML=a[i].innerHTML;
				return ;
			}
		}*/
	//	var ifm=document.getElementById("ifm");
	//	var tbl=(ifm.contentWindow.document.getElementById("aspnetForm").getElementsByTagName("TABLE"));
	//	 var cc=tbl[0];
		//alert(convert_string_to_xml().getElementById("aspnetForm").innerHTML);

		//	getElementsByTagName()	getElementsByTagName(v)	IHTMLElementCollection
	}
	function listAllStates()   
	{    
	  
	var xmlDoc;
	var xmlString =ajaxSyncCall("oo.jsp");//'<?xml version="1.0" encoding="UTF-8"?><d><div id="aspnetForm">123456</div></d>';//'<?xml version="1.0" encoding="UTF-8"?><states><state>wei</state></states>';
		// Mozilla and Netscape browsers
		if (document.implementation.createDocument){
			var parser = new DOMParser();
			xmlDoc = parser.parseFromString(xmlString, "application/xml");
			// MSIE
		}else if(window.ActiveXObject) {   
	       xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
	        xmlDoc.async="false"  
	        xmlDoc.loadXML(xmlString)   
	    }
	    var x = xmlDoc.getElementsByTagName("div");
	  	alert(xmlDoc);
		alert(x.length);
	}
	Ext.onReady(function() {
		Ext.form.Field.prototype.msgTarget = 'side'// under(菱形式) side(大饼式)
			 new Ext.Panel({
				 title:'aaa',
				layout : 'column',
				border : false,
				labelSeparator : ':',
				renderTo:'divwin',
				items:[new Ext.form.TextField({fieldLabel:'aaa',value:'ddd'})]
		}); 
	});
</script>
</head>
<body>
		<div id="divwin"><font color="red">ddd</font></div>
	 
 	<h1>我的第一个google页面s</h1>
 	<input type="button" onclick='tryClick()' value="tryClick">
 	<br /><br />
 	<%=Common.getAppPath() %>
 	<br /><br />
 	<table border="1">
 		<thead>
 				<td>userid</td>
 				<td>username</td>
 				<td>userpwd</td>
 		</thead>
 	 <%
 	 	List<DelTest> list=PMF.getListByQl("select from "+DelTest.class.getName());
 	 	for(int i=0;i<list.size();i++){
 	 		DelTest user=list.get(i);
 	 %>
 	 	<tr>
 	 		<td><%=user.getId() %></td>
 	 		<td><%=user.getA() %></td>
 	 		<td> </td>
 	 	</tr>
 	 	
 	 <%} %>
 	</table>
 	<input type='text' value='200822524654' id="userid">
 	<input type='button' value='删除' onclick='del()' id="dd">
 	<input type='button' value='添加' onclick='add()' id="addd">
 	<input type='button' value='sss' onclick='sss()' id="fff">
 	
 	<div>  
 	
 	</div>
</body>
</html>